<table align="center" cellpadding="5" cellspacing="0">    
    <tr>
    <td width="20%"><?php echo Kohana::lang('product_lang.lbl_category')?>:</td>
    <td>
    <div style="float:left;">
    <select id="categories_id" name="categories_id">
      <?php 			
            $root = ORM::factory('category')->__get('root');							
            $selected = '';
      ?>          
      <option value="<?php echo $root->categories_id;?>" <?php echo $selected;?>>- - - None - - -</option>	<!-- show root categories -->          
      <?php for($i=0; $i<count($list_category); $i++) { ?>
      <?php if ($list_category[$i]['categories_left'] != 1) { ?>
      <option value="<?php echo $list_category[$i]['categories_id']?>"
		<?php if (isset($mr) && $list_category[$i]['categories_id']==$mr[0]['master_categories_id']) { ?>
        selected="selected"
        <?php } // end if?>
      > 
      <?php	 				
                $expand = '';
                for ($k=1;$k<$list_category[$i]['categories_level'];$k++)
                    $expand .= '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
                $expand .= '|----';			
      ?>
      <?php echo $expand;?>                  
      <?php $languages = $list_category[$i]['languages']?>
      <?php for($j=0; $j<count($list_language); $j++){ ?>
      <?php if($j>0) echo '|'?>
      <?php echo $languages[$j]['categories_name']?>
      <?php } ?>
      </option>         
      <?php } // end if ?> 
      <?php } // end for?>
    </select>
    </div>
    </td>
  </tr>
  <tr>
    <td width="20%"><?php echo Kohana::lang('product_lang.lbl_show')?>:</td>
    <td>
    <div style="float:left;">
    <select id="sel_show" name="sel_show">
        <option value="0">- - -</option>
        <option value="1" <?php if(isset($mr[0]['products_show']) && $mr[0]['products_show']==1) echo "selected=\"selected\""; ?> ><?php echo Kohana::lang('product_lang.lbl_new')?></option>
        <option value="2" <?php if(isset($mr[0]['products_show']) && $mr[0]['products_show']==2) echo "selected=\"selected\""; ?>><?php echo Kohana::lang('product_lang.lbl_hot')?></option>
        <option value="3" <?php if(isset($mr[0]['products_show']) && $mr[0]['products_show']==3) echo "selected=\"selected\""; ?>><?php echo Kohana::lang('product_lang.lbl_clearance')?></option>
    </select>   
    </div>
    </td>
  </tr>    
  <?php for($i=0; $i<count($list_language); $i++){ ?>
  <tr>
    <td><?php echo Kohana::lang('product_lang.lbl_name')?>: <font color="#FF0000">*</font> [<?php echo $list_language[$i]['languages_name'];?>]</td>
    <td><div style="float:left;">
        <input value="<?php if (isset($mr[$i]['products_name'])) echo $mr[$i]['products_name']; ?>" id="txt_name<?php echo $list_language[$i]['languages_id']?>" name="txt_name<?php echo $list_language[$i]['languages_id']?>" size="50"/>
        </div>
        <div style="float:left;padding-left:10px;">
        <img src="<?php echo $this->site['base_url']?>uploads/language/<?php echo $list_language[$i]['languages_image']?>" width="20" height="20" />
        </div>
    </td>
  </tr>
  <?php } ?>
  <tr>
    <td><?php echo Kohana::lang('product_lang.lbl_no')?>:</td>
    <td><input type="text" id="txt_no" name="txt_no" size="50" value="<?php if(isset($mr[0]['products_no'])) echo $mr[0]['products_no']?>" /></td>
  </tr>
  <?php for($i=0; $i<count($list_language); $i++){ ?>
  <tr>
    <td valign="top"><?php echo Kohana::lang('product_lang.lbl_summary')?>: [<?php echo $list_language[$i]['languages_name'];?>]</td>
    <td><textarea id="txt_summary<?php echo $list_language[$i]['languages_id']?>" name="txt_summary<?php echo $list_language[$i]['languages_id']?>" cols="63" rows="5" ><?php if (isset($mr[$i]['products_summary'])) echo $mr[$i]['products_summary']; ?></textarea></td>
  </tr>
  <?php } ?>
  <?php for($i=0; $i<count($list_language); $i++){ ?>
  <tr>
    <td nowrap="nowrap"><?php echo Kohana::lang('product_lang.lbl_description')?>: [<?php echo $list_language[$i]['languages_name'];?>]</td>
    <td><img src="<?php echo $this->site['base_url']?>uploads/language/<?php echo $list_language[$i]['languages_image']?>" width="20" height="20" /></td>
  </tr>
  <tr>
    <td colspan="2" valign="top">
    <textarea class="ckeditor" cols="50" rows="5" style="width:800px;height:100px" id="txt_description<?php echo $list_language[$i]['languages_id'];?>" name="txt_description<?php echo $list_language[$i]['languages_id'];?>"><?php if (isset($mr[$i]['products_description'])) echo $mr[$i]['products_description'] ?></textarea>
    </td>
  </tr>
  <?php } ?>  
   <tr>
     <td><?php echo Kohana::lang('admin_lang.lbl_status')?>:</td>
     <td>
       <select id="sel_status" name="sel_status" >
         <option value="1" 
            <?php if (isset($mr[0]['products_status'])){?> 
            <?php if($mr[0]['products_status']==1){ echo 'selected'; }}?> >
           <?php echo Kohana::lang('admin_lang.lbl_active')?>
           </option>
         <option value="0" 
            <?php if (isset($mr[0]['products_status'])){?> 
            <?php if($mr[0]['products_status']!=1){ echo 'selected'; }}?> >
           <?php echo Kohana::lang('admin_lang.lbl_inactive')?>
           </option>
         </select>
         <input type="hidden" id="hd_id" name="hd_id" value="<?php if (isset($mr[0]['products_id'])) echo $mr[0]['products_id']; ?>">
       </td>
   </tr>
</table>
<script language="javascript" src="<?php echo $this->site['base_url']?>/themes/plugins/ckeditor/ckeditor.js"></script>